/*
 * @Description: test
 * @Author: rendc
 * @Date: 2024-07-30 09:13:43
 * @LastEditors: rendc
 * @LastEditTime: 2024-07-30 10:18:37
 */

// 数据类型判断
var s = "string"; // String
var strType = typeof s;
console.log('🤡 CC - strType:', strType);

var n = 123; // Number
var numType = typeof n;
console.log('🤡 CC - numType:', numType);

var b = true;
var boolType = typeof b;
console.log('🤡 CC - boolType:', boolType);

var n = null;
var nullType = typeof n;
console.log('🤡 CC - nullType:', nullType);

var u = undefined;
var undeType = typeof u;
console.log('🤡 CC - undeType:', undeType);

var o = {
  name: "ZhangSan",
  age: 12
};
var objType = typeof o;
console.log('🤡 CC - objType:', objType);

var a = [1, 2, 3];
var arrType = typeof a;
console.log('🤡 CC - arrType:', arrType);

function add (a, b) {
  return a + b;
}
var funType = typeof add;
console.log('🤡 CC - funType:', funType);


// 运算符
var a = 5;
var b = 3;
console.log('🤡 CC - a-b:', a - b);// 2
console.log('🤡 CC - a+b:', a + b);// 8

var strA = '5';
var strB = '3';
console.log('🤡 CC - a-b:', strA - strB);// 2
console.log('🤡 CC - a+b:', strA + strB);// 53

var flag = true;
console.log('🤡 CC - flag:', flag);
console.log('🤡 CC - !flag:', !flag);

var num1 = 1;
// console.log('🤡 CC - num1++:', num1++);// 2
console.log('🤡 CC - ++num1:', ++num1);// 2



var obj = {
  name: "zhangsan",
  age: 12,
  money: 10000000,
}
console.log('🤡 CC - obj:', obj);
delete obj.money
console.log('🤡 CC - obj:', obj);


// 数据类型转换
var bool1 = true;
console.log('🤡 CC - typeof bool1:', typeof bool1);

var numTrue = + bool1;
console.log('🤡 CC - numTrue:', numTrue);

var flag1 = "false";
if (flag1) {
  console.log('🤡 CC - flag:', flag);
}